<%-- 
    Document   : desplegarCategorias
    Created on : 13/03/2013, 01:13:49 PM
    Author     : user10
--%>

<%@page contentType="text/html" pageEncoding="windows-1252"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
        <link rel="STYLESHEET" type="text/css" href="${pageContext.request.contextPath}/resources/dhtmlxSuite/dhtmlxGrid/codebase/dhtmlxgrid.css">
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/resources/dhtmlxSuite/dhtmlxGrid/codebase/skins/dhtmlxgrid_dhx_skyblue.css">
<script  src="${pageContext.request.contextPath}/resources/dhtmlxSuite/dhtmlxGrid/codebase/dhtmlxcommon.js"></script>
<script  src="${pageContext.request.contextPath}/resources/dhtmlxSuite/dhtmlxGrid/codebase/dhtmlxgrid.js"></script>        
<script  src="${pageContext.request.contextPath}/resources/dhtmlxSuite/dhtmlxGrid/codebase/dhtmlxgridcell.js"></script>    
 
        <title>JSP Page</title>
    </head>
    <body>
        <div id="gridbox" style="width:500px; height:270px; background-color:white;"></div>
<br>    
<a href="javascript:void(0)" onclick='mygrid.clearAll();alert("old data cleared\nloading new one..."); mygrid.parse(data,"json")'>Reload from JSON object</a><br/>

<script>
<c:forEach var="a" items="${categorias}">
data = {
          rows: [{            
                data:[ "${a.clave}", "${a.nombre}", "${a.detalles}"]
        }]
   }
   </c:forEach>  
mygrid = new dhtmlXGridObject('gridbox');
mygrid.setImagePath("${pageContext.request.contextPath}/resources/dhtmlxSuite/dhtmlxGrid/codebase/imgs/");
mygrid.setHeader("ID, Categoria, Detalles");
mygrid.setInitWidths("70,250,*");
mygrid.setColAlign("right,left,left");
mygrid.setColTypes("dyn,ed,ed");
mygrid.setColSorting("int,str,str");
mygrid.init();
mygrid.setSkin("dhx_skyblue");
mygrid.load("${pageContext.request.contextPath}/common/data.json", "json");
</script>
        
    </body>
</html>
